/*
 * CAN_Config.h
 *
 *  Created on: Apr 21, 2022
 *      Author: ZhangJianCe
 */

#ifndef CONFIG_CAN_CONFIG_H_
#define CONFIG_CAN_CONFIG_H_


/***************CAN Channel0 Baud Config Start************/
//#define _CAN0_125K_
//#define _CAN0_250K_
//#define _CAN0_500K_
#define _CAN0_1M_
/***************CAN Channel0 Baud Config End*************/

/***************CAN Channel1 Baud Config Start************/
//#define _CAN1_125K_
//#define _CAN1_250K_
//#define _CAN1_500K_
#define _CAN1_1M_
/***************CAN Channel1 Baud Config End*************/


#if defined _CAN0_1M_
#define CAN0_PRESCAL 3u
#define CAN0_TimeSeg1 CAN_BS1_11TQ
#define CAN0_TimeSeg2 CAN_BS2_2TQ
#elif defined _CAN0_500K_
#define CAN0_PRESCAL 6u
#define CAN0_TimeSeg1 CAN_BS1_11TQ
#define CAN0_TimeSeg2 CAN_BS2_2TQ
#elif defined _CAN0_250K_
#elif defined _CAN0_500K_
#define CAN0_PRESCAL 12u
#define CAN0_TimeSeg1 CAN_BS1_11TQ
#define CAN0_TimeSeg2 CAN_BS2_2TQ
#elif defined _CAN0_125K_
#elif defined _CAN0_500K_
#define CAN0_PRESCAL 24u
#define CAN0_TimeSeg1 CAN_BS1_11TQ
#define CAN0_TimeSeg2 CAN_BS2_2TQ
#endif

#if defined _CAN1_1M_
#define CAN1_PRESCAL 3u
#define CAN1_TimeSeg1 CAN_BS1_11TQ
#define CAN1_TimeSeg2 CAN_BS2_2TQ
#elif defined _CAN1_500K_
#define CAN1_PRESCAL 6u
#define CAN1_TimeSeg1 CAN_BS1_11TQ
#define CAN1_TimeSeg2 CAN_BS2_2TQ
#elif defined _CAN1_250K_
#elif defined _CAN1_500K_
#define CAN1_PRESCAL 12u
#define CAN1_TimeSeg1 CAN_BS1_11TQ
#define CAN1_TimeSeg2 CAN_BS2_2TQ
#elif defined _CAN1_125K_
#elif defined _CAN1_500K_
#define CAN1_PRESCAL 24u
#define CAN1_TimeSeg1 CAN_BS1_11TQ
#define CAN1_TimeSeg2 CAN_BS2_2TQ
#endif


/*isRemoteFrame,isExtendedFrame,ID*/
#define CAN0_Rx_List \
{                  \
	{0,0,0x200},\
}

/*isRemoteFrame,isExtendedFrame,ID*/
#define CAN1_Rx_List \
{                      \
	{0,0,0x200},\
}

#endif /* CONFIG_CAN_CONFIG_H_ */
